-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Xamarin.Android.Build.Tasks] Updates for xabuild.exe #940
Conversation
@@ -21,6 +21,10 @@ public static bool Create (string source, string target) | |||
} | |||
} else { | |||
try { | |||
var sourceInfo = new UnixFileInfo (source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's odd, it sounds like this Directory.Exists
check isn't working. Is there a test/app I can try to see this breaking?
Is there a way to do this where the symbolic link is recreated on Windows, too? Is delete directory/recreate the link the only way to do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how this would work on windows.
I hit this by running the msbuild unit tests using MSBUILD=msbuild.
so just using MSBUILD=msbuild xabuild
should repo the problem.
return Path.GetFullPath (Path.Combine (Root, "..", "..", "tools", "scripts", "xabuild")); | ||
var xaBuildPath = Path.GetFullPath (Path.Combine (Root, "..", "..", "tools", "scripts", "xabuild")); | ||
if (!File.Exists (xaBuildPath)) | ||
xaBuildPath = Path.GetFullPath (Path.Combine (Root, "..", "..", "..", "..", "..", "..", "..", "tools", "scripts", "dbuild")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix the unit tests in monodroid.
tools/xabuild/SymbolicLink.cs
Outdated
return true; | ||
} | ||
Console.Error.WriteLine ($"Unable to create symbolic link from `{source}` to `{target}`: {exc}"); | ||
return Directory.Exists (source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we add the same return Directory.Exists (source)
for Windows, we're good.
I tested what happens on Windows if you try to create a symlink (and it already exists). It gives a generic error message The system cannot find the file specified
, so we don't have a way to check for the specific error condition.
a4e87c7
to
94cffa2
Compare
This commit fixes a couple of issues which appeared when using xabuild.exe on macos. Firstly if the symlink exists already the SymbolicLink code will error out and fail the build completely. This happens because if you run two or more xabuild.exe instances at the same time they trip over each other trying to create the symlink. So rather than erroring completely we should only error if the link does NOT exist. If it does exist after an attempted creation we should ignore the exception. The other is about where we look for extensions. Xamarin.Android is installed on mac into /Library/Frameworks/Mono.framework/External/xbuild this was not included in the search path for MSbuild, so it never manages to find the required .targets.
94cffa2
to
af4e4bf
Compare
This commit fixes a couple of issues which appeared when using `xabuild.exe` on macOS. Firstly if the symlink exists already the SymbolicLink code will error out and fail the build completely. This happens because if you run two or more `xabuild.exe` instances at the same time they trip over each other trying to create the symlink. So rather than error'ing completely we should only error if the link does NOT exist. If it does exist after an attempted creation we should ignore the exception. The other is about where we look for extensions. Xamarin.Android is installed on macOS into /Library/Frameworks/Mono.framework/External/xbuild this was not included in the search path for MSBuild, so it never manages to find the required `.targets` files.
This commit fixes a couple of issues which appeared when
using xabuild.exe on macos. Firstly if the symlink exists
already the SymbolicLink code will error out and fail the
build completely. This happens because if you run two or
more xabuild.exe instances at the same time they trip over
each other trying to create the symlink.
So rather than erroring completely we should only error if
the link does NOT exist. If it does exist after an attempted
creation we should ignore the exception.
The other is about where we look for extensions. Xamarin.Android
is installed on mac into
this was not included in the search path for MSbuild, so it never
manages to find the required .targets.